import { Component, OnInit } from '@angular/core';
import { NzModalService } from 'ng-zorro-antd/modal';
import { PluginFormComponent } from '../plugin-form/plugin-form.component';

@Component({
  selector: 'app-plugin',
  templateUrl: './plugin.component.html',
  styleUrls: ['./plugin.component.scss'],
})
export class PluginComponent implements OnInit {
  constructor(private modalService: NzModalService) {}

  ngOnInit(): void {}

  optionList = [
    { label: 'cc(cc)', value: '1' },
    { label: 'dwptest(dwptest)', value: '2' },
  ];

  dataSet = [
    {
      index: 1,
      id: 1,
      name: 'demoPlugin',
      desc: 'demo',
      defined: '[{"username":"zhangsan","passw...',
      option: 'a->b',
    },
    {
      index: 2,
      id: 2,
      name: 'unifiedLoginValidatePluginFilter',
      desc: 'unified',
      defined: '[{"username":"zhangsan","passw...',
      option: 'a->b',
    },
  ];

  handleAdd() {
    this.modalService.create({
      nzTitle: '新增插件',
      nzContent: PluginFormComponent,
      nzWidth: 900,
      nzFooter: null,
    });
  }
}
